let shopId = window.location.pathname.split('/')[1]
const prefix = '/' + shopId
let basisRouter = [
  {
    path: prefix,
    name: '节点管理',
    component: resolve => {
      require(['src/views/home/index'], resolve)
    },
    meta: {
      name: 'model',
      title: '节点管理'
    },
    icon: 'el-icon-office-building',
    children: [
      {
        path: prefix + '/model-node/list',
        name: 'modelnoderecords',
        component: resolve => {
          require(['src/views/model-node/list.vue'], resolve)
        },
        meta: {
          title: '节点管理'
        }
      }
    ]
  },

  {
    path: prefix,
    name: '区域管理',
    component: resolve => {
      require(['src/views/home/index'], resolve)
    },
    meta: {
      name: 'area',
      title: '区域管理'
    },
    icon: 'el-icon-office-building',
    children: [
      {
        path: prefix + '/area/list',
        name: 'arearecords',
        component: resolve => {
          require(['src/views/area/list.vue'], resolve)
        },
        meta: {
          title: '区域管理'
        }
      }
    ]
  },

  {
    path: prefix,
    name: '视频管理',
    component: resolve => {
      require(['src/views/home/index'], resolve)
    },
    meta: {
      name: 'video',
      title: '视频管理'
    },
    icon: 'el-icon-office-building',
    children: [
      {
        path: prefix + '/video/list',
        name: 'videorecords',
        component: resolve => {
          require(['src/views/video/list.vue'], resolve)
        },
        meta: {
          title: '视频管理'
        }
      }
    ]
  },

  {
    path: prefix,
    name: '账号权限',
    component: resolve => {
      require(['src/views/home/index'], resolve)
    },
    meta: {
      name: 'userList',
      title: '账号管理'
    },
    icon: 'el-icon-self-duizhang',
    children: [
      {
        path: prefix + '/permissions/userList',
        name: 'userList',
        component: resolve => {
          require(['src/views/firm/permissions/home'], resolve)
        },
        meta: {
          title: '账号管理'
        },
        redirect: prefix + '/permissions/userList',
        children: [
          {
            path: prefix + '/permissions/userList',
            name: 'userList',
            component: resolve => {
              require(['src/views/firm/permissions/userList'], resolve)
            },
            meta: {
              title: '账号管理'
            }
          },
          {
            path: prefix + '/permissions/rolelist',
            name: 'rolelist',
            component: resolve => {
              require(['src/views/firm/permissions/rolelist'], resolve)
            },
            meta: {
              title: '权限管理'
            }
          }
        ]
      }
    ]
  },
  // 找不到页面
  {
    isTrue: true,
    path: '*',
    name: 'Unfoundpage',
    component: () => import('src/views/login/Unfoundpage'),
    hidden: true,
    meta: {
      name: '',
      title: '找不到页面'
    }
  }
]
export default {
  basisRouter
}
